jsx3.lang.Package.definePackage("tibco.admin.enterpriseAssets.envDef.envDtls.eMachines", function (envMachinesPak) {
});

jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.envDef.envDtls.eMachines.EnvMachinesPlugin",
        jsx3.lang.Object,
        [tibco.admin.enterpriseAssets.envDef.envDtls.EnvDtlsNavInterface],
        function (envMachines) {

            envMachines.mtxList = null;
            envMachines.environmentName = null
            envMachines.entityID = null;
            envMachines.version = null;
            envMachines.instance = null;

            envMachines.getInstance = function(args) {
                if(!envMachines.instance) {
                    envMachines.instance = new tibco.admin.enterpriseAssets.envDef.envDtls.eMachines.EnvMachinesPlugin();
                }
                return envMachines.instance;
            };

            envMachines.prototype.getNamespace = function() {
                return "tibco.admin";
            };

            envMachines.prototype.loadComponent = function(parent) {
                var me = this;
                tibco.admin.Main.loadUIResourceAsync(parent, this.getNamespace(), "tibco/admin/enterpriseAssets/envDef/envDtls/eMachines/ui/mList.xml", me, me.componentLoaded);
            };

            //interface method
            envMachines.prototype.getNavLinkText = function() {
                //todo: no hard coding, use dynamic property
                return tibco.admin.Main.getServer().getDynamicProperty("@@NavLinkTextMachines");
            };

            envMachines.prototype.componentLoaded = function(objEvent) {
                if(objEvent.status == "SUCCESS") {
                    this.block = objEvent.obj;
                    var me = this;
                    this.block.handler = me;
                }
                else {
                    if(objEvent.exception)
                    {
                        tibco.admin.Main.logException(objEvent.exception, objEvent.message);
                    }
                    else {
                        jsx3.log(objEvent.message);
                    }
                }
            }

            envMachines.prototype.getComponentPath = function() {
                return  "tibco/admin/enterpriseAssets/envDef/envDtls/eMachines/component.xml"
            }

            envMachines.prototype.buttonSelected = function() {
                if(this.block) {
                    this.block.callgetProductInventoryInEnterprise();
                }
            }
        })
        ;